import requests
import re
import json
from bs4 import BeautifulSoup

url = "http://music.taihe.com/artist/2319312"
html = requests.get(url)
html.encoding = "utf-8"
soup = BeautifulSoup(html.text, features="lxml")
list = soup.find_all("a", attrs={"class": "page-navigator-number PNNW-S"})
pageSize = int(list[len(list) - 1].string)

pageUrl = "http://music.taihe.com/data/user/getsongs?start=30namelink&size=15&ting_uid=2517"
html = requests.get(pageUrl)
html.encoding = "utf-8"
obj = json.loads(html.text)
soup = BeautifulSoup(obj["data"]["html"], features="lxml")
list = soup.find_all("a", attrs={"class": "namelink"})
print(list)
